package com.example.jetpacker.livedata

import androidx.lifecycle.MutableLiveData
import androidx.lifecycle.ViewModel

class LivedataViewModel() : ViewModel() {

    val counter = MutableLiveData<Int>()

    fun plusOne() {
        val count = counter.value ?: 0
        counter.value = count + 1
    }

    fun clear() {
        counter.value=0
    }

}